#coding: utf-8
import requests

html = requests.get("http://music.baidu.com/tag/流行")
html.encoding = 'utf-8'
data = (html.text)
with open ("./html.txt","w") as txt:
    txt.write(data)
txt.close()

with open('./html.txt','r') as data:
    for read_line in data:
        #print (read_line)
        if read_line.find("song-title") != -1:
            if read_line.find("title=") != -1:
                title_start = int(read_line.find('title="'))+7
                title_stop = int(read_line.find('"',title_start))
                print(read_line[title_start:title_stop])
